<?php

/**
 * info actions.
 *
 * @package    sf_sandbox
 * @subpackage info
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
 */
class infoActions extends sfActions
{
    public function executeIndex()
    {
    }
    public function executeAbout()
    {
    }
    public function executeContact()
    {
    }
    public function executeEconomicCalendar()
    {
    }
    public function executeFaq()
    {
    }
    public function executeFoundingCover()
    {
    }
    public function executeLearningCenter()
    {
    }
    public function executeLocalBank()
    {
    }
    public function executeMoneybooker()
    {
    }
    public function executeNeteller()
    {
    }
    public function executeWireTransfer()
    {
    }
    public function executeSendFeedback()
    {
        if ($this->getRequestParameter('email') <> "" && $this->getRequestParameter('name') <> "") {
            $subject = "Fxm2uLtd Member Feedback";
            $msg  = "FXM2U<br>";
            $msg .= "======================================<br>";
            $msg .= "Submitted by ".$this->getRequestParameter('name').' on '.date("d-M-Y H:m")."<br><br>";
            $msg .= "First Name       : \t".$this->getRequestParameter('name')."<br><br>";
            $msg .= "email       : \t".$this->getRequestParameter('email')."<br><br>";
            $msg .= "Telephone           : \t".$this->getRequestParameter('telephone')."<br>";
            $msg .= "======================================<br>";
            $msg .= "message         : \t".$this->getRequestParameter('message')."<br>";
            $msg .= "======================================<br>";
            $msg .= "* Thank you, your submission has been received. Our staff will attend to this shortly <br>";

            error_reporting(E_STRICT);

            date_default_timezone_set(date_default_timezone_get());

            include_once('class.phpmailer.php');
            $mail = new PHPMailer();

            if (Mails::EMAIL_SMTP == true) {
                $mail->IsSMTP();
                $mail->Port = Mails::EMAIL_PORT;
                $mail->SMTPDebug = 1; // telling the class to use SMTP
                $mail->SMTPAuth = true; // telling the class to use SMTP
                $mail->SMTPSecure = "ssl"; // telling the class to use SMTP
                $mail->Username = Mails::EMAIL_SENDER;
                $mail->Password = Mails::EMAIL_PASSWORD;
            } else {
                $mail->IsMail();
                $mail->Sender = Mails::EMAIL_SENDER;
            }

            $mail->Host = Mails::EMAIL_HOST; // SMTP server
            $mail->From = Mails::EMAIL_FROM_NOREPLY;
            $mail->FromName = Mails::EMAIL_FROM_NOREPLY_NAME;
            $mail->Subject = $subject;
            $mail->CharSet="utf-8";

            $text_body = $msg;

            $mail->Body = $msg;
            $mail->AltBody = $text_body;
            $mail->AddAddress(Mails::EMAIL_SENDER, "admin");
            $mail->AddBCC("r9projecthost@gmail.com", "jason");

            if (!$mail->Send()) {
                echo $mail->ErrorInfo;
            }
        }

        $this->setFlash('successMsg', $this->getContext()->getI18N()->__("Thank you for feedback. We shall revert to you the soonest possible."));
        return $this->redirect('/info/contact');
    }
}
